package com.eleven.trades.controller;

import com.eleven.trades.entity.Account;
import com.eleven.trades.result.JsonResult;
import com.eleven.trades.result.JsonResultFactory;
import com.eleven.trades.result.ResultCode;
import com.eleven.trades.server.AccountServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author linhaizeng
 */
@RestController
public class SignController {
    @Autowired
    AccountServer accountServer;

    /**
     * 验证账户密码
     * @param account
     * @return
     */
    @PostMapping("/valid_paypassword")
    public JsonResult validPayPassword(@RequestBody Account account){
        return accountServer.validPassPassword(account.getAccountId(), account.getPayPassword())? JsonResultFactory.getInstance().buildSuccessResult() :
        JsonResultFactory.getInstance().buildFailResult(ResultCode.COMMON_FAIL);

    }
}
